package com.x.attendance.assemble.control.jaxrs.fingerprint;

import com.google.gson.JsonElement;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.logger.Logger;
import com.x.base.core.project.logger.LoggerFactory;

public class ActionCollectFingerprint extends BaseAction {

    private static Logger logger = LoggerFactory.getLogger(ActionCollectFingerprint.class);

    public ActionResult<Wo> execute(EffectivePerson effectivePerson, String employeeId, JsonElement jsonElement) throws Exception {
        ActionResult<Wo> result = new ActionResult<>();
        
        try {
            // TODO: 实现指纹采集逻辑
            Wo wo = new Wo();
            wo.setSuccess(true);
            wo.setQuality(85);
            wo.setMessage("指纹采集成功");
            result.setData(wo);
        } catch (Exception e) {
            logger.error(e);
            throw e;
        }
        
        return result;
    }

    public static class Wo {
        private Boolean success;
        private Integer quality;
        private String message;
        private String fingerprintData;

        public Boolean getSuccess() {
            return success;
        }

        public void setSuccess(Boolean success) {
            this.success = success;
        }

        public Integer getQuality() {
            return quality;
        }

        public void setQuality(Integer quality) {
            this.quality = quality;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }

        public String getFingerprintData() {
            return fingerprintData;
        }

        public void setFingerprintData(String fingerprintData) {
            this.fingerprintData = fingerprintData;
        }
    }
}

